package com.mavenq.fly.business.service;

import com.mavenq.fly.test.Times;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

import java.util.concurrent.TimeUnit;

@Component
@Slf4j
public class AsyncTask {

    @Async()
    public void register() {
        log.info("多线程开始注册模拟");
        try {
            TimeUnit.SECONDS.sleep(1);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        log.info("多线程注册成功");
    }

}